
reserve function Mod_Draw
reserve function Mod_BG
reserve function Mod_Description
reserve function Mod_Gone
reserve function Mod_Header
reserve function WirdCheck
reserve function mods.exit
reserve function mods.control
reserve function mods.wait
reserve function mods.pop
reserve function mods.sound


//-------Aliases-------//
private alias object.value1 : object.modhighlight
private alias object.value2 : object.modtodraw
private alias object.value3 : line.xpos
private alias object.value4 : line.ypos
private alias object.value5 : mod.bg.scroll
private alias object.value6 : mod.menu.scroll
private alias object.value7 : mod.min.scroll
private alias object.value8 : mod.max.scroll
private alias object.value9 : mod.bglines
private alias object.value10 : mod.starstate
private alias object.value11 : mod.starx
private alias object.value12 : mod.stary
private alias object.value13 : mod.startick
private alias object.value14 : desc.xoffset
private alias object.value16 : loading
private alias object.value17 : touch.inputReset

public alias object[9].value17 : touch.delay
public alias object[9].value18 : touch.fade
public alias object[9].value19 : touch.inputReset
public alias object[9].value20 : touch.X1Pos
public alias object[9].value21 : touch.X2Pos
public alias object[9].value22 : touch.Y1Pos
public alias object[9].value23 : touch.Y2Pos
public alias object[9].value24 : touch.confirm

private alias object.value15 : mods.exTime
private alias 6 : mod.startime

private alias object[9].value0 : menu.state
private alias object[9].value1 : target.xoffset
private alias object[9].value2 : current.xoffset


public table headerspace
	16, 16, 16, 16, 15, 15, 17, 16, 7, 15, 17, 16, 17, 16, 17, 16, 17, 17, 15, 15, 16, 16, 23, 16, 16, 16
end table

private table charspace
	3, 6, 10, 9, 9, 9, 3, 4, 4, 7, 9, 3, 7
	3, 11, 7, 5, 7, 7, 7, 7, 7, 7, 7, 7, 3
	3, 6, 6, 6, 6, 10, 9, 8, 9, 9, 7, 7, 9
	11, 5, 8, 9, 6, 11, 9, 10, 7, 10, 7, 7
	9, 10, 9, 15, 9, 11, 9, 4, 11, 4, 5, 7
	4, 9, 8, 9, 9, 7, 7, 9, 11, 5, 8, 9, 6
	11, 9, 10, 7, 10, 7, 7, 9, 10, 9, 15, 9
	11, 9, 5, 3, 5, 9
end table

function mods.sound
	temp0 = inputPress.left
	temp0 |= inputPress.right
	if modcount > 1
		temp0 |= inputPress.up
		temp0 |= inputPress.down
	end if
	if temp0 == 1
		PlaySfx(SfxName[Hover], 0)
	end if
end function

function mods.control
	if inputPress.buttonB == 1
		object.state = mods.exit
	else
		if modcount > 0			
			CallFunction(mods.sound)
			if inputDown.buttonA == 1
				if inputPress.up == 1
					CallNativeFunction2(MoveMod, object.modhighlight, 1)
					CallFunction(mods.pop)
					if object.modhighlight > 0
						object.modhighlight--
					end if
					
				end if
				if inputPress.down == 1					
					CallNativeFunction2(MoveMod, object.modhighlight, 0)
					CallFunction(mods.pop)
					object.modhighlight++
					if object.modhighlight >= modcount
						object.modhighlight--
					end if
				end if				
			else
				if inputPress.up == 1
					object.modhighlight--
					if object.modhighlight < 0
						object.modhighlight += modcount
					end if
				end if
				if inputPress.down == 1
					object.modhighlight++
					object.modhighlight %= modcount
				end if
				
				temp0 = inputPress.left
				temp0 |= inputPress.right
				if temp0 == 1
					CallNativeFunction2(GetModActive, object.modhighlight, 0)
					checkResult ^= 1
					CallNativeFunction2(SetModActive, object.modhighlight, checkResult)
				end if
			end if
		end if
	end if
end function

function mods.wait
	mods.exTime -= 16
	if mods.exTime == 0
		object.state = mods.control
		mods.exTime = 0
		PlayMusic(1)
	end if
end function

function mods.exit
	mods.exTime += 16
	music.volume -= 6

	if mods.exTime >= 330
		CallNativeFunction(RefreshEngine)	
		stage.listPos = StageName[P - MAIN MENU]
		LoadStage()
		loading = 1
	end if
end function

event ObjectMain
	if object.state == 0
		object.state = mods.wait
		if screen.xsize == 320
			desc.xoffset = 10
		else
			desc.xoffset = 50
		end if
	else
	if saved.mobile == 1
		CheckTouchRect(0, 0, screen.xsize, screen.ysize)
		if checkResult == -1
			touch.inputReset = false
		end if
	end if	
	if touch.inputReset == false
				CheckTouchRect(48, 34, 64, 48)
				if checkResult > -1
					touch.inputReset = true
					inputDown.buttonA = 1
					inputPress[0].up = true
				end if
				CheckTouchRect(48, 180, 64, 194)
				if checkResult > -1
					touch.inputReset = true
					inputDown.buttonA = 1
					inputPress[0].down = true
				end if

				touch.y1pos = 50
				touch.y1pos -= mod.menu.scroll
				touch.x1pos = screen.xsize
				touch.x1pos -= 60
				temp0 = 0
				while temp0 < modcount
					temp7 = touch.y1pos
					temp7 += 35
					CheckTouchRect(touch.x1pos, touch.y1pos, screen.xsize, temp7)
					if checkResult > -1
						object.value1 = temp0
						touch.inputReset = true
						CallNativeFunction2(GetModActive, temp0, 0)
						checkResult ^= 1
						CallNativeFunction2(SetModActive, temp0, checkResult)
					else
						CheckTouchRect(100, touch.y1pos, touch.x1pos, temp7)
						if checkResult > -1
							object.value1 = temp0
							touch.inputReset = true
						end if	
					end if
					temp0++
					touch.y1pos += 36
				loop	
		end if		
		CallFunction(object.state)
	end if
end event


function WirdCheck
	temp2 = temp3
	
end function

function Mod_Draw
	if object.modtodraw == object.modhighlight
		temp4 = line.ypos
		temp4 -= 9
		DrawRect(0, temp4, screen.xsize, 30, color7, color7, color7, 255)
		temp4++
		DrawRect(0, temp4, screen.xsize, 28, 0, 0, 0, 255)
		temp4++
		if inputDown.buttonA == 1
			DrawRect(0, temp4, screen.xsize, 26, color7, color7, 0, 255)
		else
			DrawRect(0, temp4, screen.xsize, 26, color3, color6, 0, 255)
		end if
		temp4++
		DrawRect(0, temp4, screen.xsize, 24, 0, 0, 0, 255)
		if inputDown.buttonA == 1
			temp4 += 6
			DrawSpriteScreenXY(313, 5, temp4)
			if inputDown.up == 1
				DrawSpriteScreenXY(314, 13, temp4)
			end if
			if inputDown.down == 1
				DrawSpriteScreenXY(315, 13, temp4)
			end if
			temp4 -= 6
		end if		
	end if
	
	temp3 = 32
	if saved.mobile == 1
		temp3 += 64
		DrawSpriteScreenXY(311, temp3, 34)
		DrawSpriteScreenXY(312, temp3, 180)
	end if

	if screen.xsize == 320
		temp3 =5
	end if
	DrawSpriteScreenXY(272, temp3, line.ypos)
	
	temp3 += 32
	temp4 = line.ypos
	
	temp5 = object.modtodraw
	temp5 <<= 2
	GetTextInfo(temp0, 0, TEXTINFO_TEXTSIZE, temp5, 0)
	temp1 = 0
	while temp1 < temp0 //Mod Title
		GetTextInfo(temp2, 0, TEXTINFO_TEXTDATA, temp5, temp1)
		if temp2 > 32
			temp2 -= 33
			GetTableValue(temp6, temp2, charspace)
			temp2 += 176
			DrawSpriteScreenXY(temp2, temp3, temp4)
			temp3 += temp6
		else
			temp3 += 6
		end if
		temp1++
	loop
	temp3 += 6
	
	
	temp3 = screen.xsize
	temp3 -= 10
	CallNativeFunction2(GetModActive, object.modtodraw, 0)
	if checkResult == 1
		DrawSpriteScreenXY(270, temp3, line.ypos)
	else
		DrawSpriteScreenXY(271, temp3, line.ypos)
	end if	
end function

function Mod_Gone
	DrawRect(0, 199, screen.xsize, 1, color7, color7, color7, 255)
	DrawRect(0, 200, screen.xsize, 40, 0, 0, 0, 255)
	DrawRect(0, 201, screen.xsize, 1, color7, color7, 0, 255)
	
	temp3 = desc.xoffset
	temp4 = 206
	
	temp5 = object.modhighlight
	temp5 <<= 2
	temp5+= 2 //Mod Decsription
	GetTextInfo(temp0, 0, TEXTINFO_TEXTSIZE, 0, 0)
	temp1 = 0
	while temp1 < temp0
		GetTextInfo(temp2, 0, TEXTINFO_TEXTDATA, 0, temp1)
		DrawSpriteScreenXY(temp2, temp3, temp4)
		temp3 += 8
		temp1++
	loop
	
	temp3 = desc.xoffset
	temp4 += 10
	
	temp5 = object.modhighlight
	temp5 <<= 2
	temp5+= 2 //Mod Decsription
	GetTextInfo(temp0, 0, TEXTINFO_TEXTSIZE, 1, 0)
	temp1 = 0
	while temp1 < temp0
		GetTextInfo(temp2, 0, TEXTINFO_TEXTDATA, 1, temp1)
		DrawSpriteScreenXY(temp2, temp3, temp4)
		temp3 += 8
		temp1++
	loop
	
	temp3 = desc.xoffset
	temp4 += 10
	
	temp5 = object.modhighlight
	temp5 <<= 2
	temp5+= 2 //Mod Decsription
	GetTextInfo(temp0, 0, TEXTINFO_TEXTSIZE, 2, 0)
	temp1 = 0
	while temp1 < temp0
		GetTextInfo(temp2, 0, TEXTINFO_TEXTDATA, 2, temp1)
		DrawSpriteScreenXY(temp2, temp3, temp4)
		temp3 += 8
		temp1++
	loop
end function

function Mod_Description
	DrawRect(0, 199, screen.xsize, 1, color7, color7, color7, 255)
	DrawRect(0, 200, screen.xsize, 40, 0, 0, 0, 255)
	DrawRect(0, 201, screen.xsize, 1, color7, color7, 0, 255)
	
	temp3 = desc.xoffset
	temp4 = 206
	
	temp6 = screen.xsize
	temp6 -= 20
	
	temp5 = object.modhighlight
	temp5 <<= 2 //Mod Name
	GetTextInfo(temp0, 0, TEXTINFO_TEXTSIZE, temp5, 0)
	temp1 = 0
	while temp1 < temp0
		GetTextInfo(temp2, 0, TEXTINFO_TEXTDATA, temp5, temp1)
		DrawSpriteScreenXY(temp2, temp3, temp4)
		temp3 += 8
		if temp3 >= temp6
			temp3 = 75
			temp4 += 10
		end if
		temp1++
	loop
	temp3 += 24
	temp5 ++ //Mod Version
	GetTextInfo(temp0, 0, TEXTINFO_TEXTSIZE, temp5, 0)
	temp1 = 0
	while temp1 < temp0
		GetTextInfo(temp2, 0, TEXTINFO_TEXTDATA, temp5, temp1)
		DrawSpriteScreenXY(temp2, temp3, temp4)
		temp3 += 8
		temp1++
	loop
	
	temp3 = desc.xoffset
	temp4 += 10
	
	temp5++ //Mod Author
	GetTextInfo(temp0, 0, TEXTINFO_TEXTSIZE, temp5, 0)
	temp1 = 0
	while temp1 < temp0
		GetTextInfo(temp2, 0, TEXTINFO_TEXTDATA, temp5, temp1)
		DrawSpriteScreenXY(temp2, temp3, temp4)
		temp3 += 8
		if temp3 >= temp6
			temp3 = 75
			temp4 += 10
		end if
		temp1++
	loop
	
	temp3 = desc.xoffset
	temp4 += 10
	
	temp5++ //Mod Decsription
	GetTextInfo(temp0, 0, TEXTINFO_TEXTSIZE, temp5, 0)
	temp1 = 0
	while temp1 < temp0
		GetTextInfo(temp2, 0, TEXTINFO_TEXTDATA, temp5, temp1)
		DrawSpriteScreenXY(temp2, temp3, temp4)
		temp3 += 8
		if temp3 >= temp6
			temp3 = 75
			temp4 += 10
		end if
		temp1++
	loop
end function

function Mod_BG
	DrawRect(0, 0, screen.xsize, screen.ysize, 0, 0, 0, 255)
	
	//Small Squares
	temp0 = 0
	temp1 = 0
	while temp1 < 176
		while temp0 < screen.xsize
			DrawSpriteScreenXY(274, temp0, temp1)
			temp0 += 8
		loop
		temp0 = 0
		temp1 += 8
	loop
	
	//Large squares
	temp0 = 0
	temp1 = 176
	while temp1 < screen.ysize
		while temp0 < screen.xsize
			DrawSpriteScreenXY(275, temp0, temp1)
			temp0 += 24
		loop
		temp0 = 0
		temp1 += 24
	loop
	
	//Scrolling lines
	mod.bglines++
	mod.bglines &= 63
	
	temp2 = mod.bglines
	temp2 >>= 4
	temp0 = 176
	temp1 = 1
	while temp0 < screen.ysize
		DrawRect(0, temp0, screen.xsize, 1, color7, color7, color7, 127)
		temp1 <<= 1
		temp0 += temp1
		temp0 += temp2		
	loop
	
	//Stars
	if mod.starstate == 0
		rand(temp0, 5)
		temp0 = 1
		if temp0 == 1
			mod.starstate = 1
			rand(mod.starx, screen.xsize)
			rand(mod.stary, 160)
			mod.stary+= 8
		end if
	else
		mod.startick++
		if mod.startick >= mod.startime
			mod.startick = 0
			mod.starstate++
		end if
		if mod.starstate > 6
			mod.starstate = 0
		else
			temp0 = mod.starstate
			temp0 += 275
			DrawSpriteScreenXY(temp0, mod.starx, mod.stary)
		end if
	end if	
end function

function Mod_Header
	DrawRect(0, 0, screen.xsize, 29, 0, 0, 0, 255)
	DrawRect(0, 25, screen.xsize, 1, color7, color7, 0, 255)
	DrawRect(0, 28, screen.xsize, 1, color7, color7, color7, 255)
	
	CopyPalette(0, 218, 0, 240, 5)
	GetTextInfo(temp0, 1, TEXTINFO_TEXTSIZE, 90, 0)
	temp1 = 0
	temp3 = 0
	temp5 = 0
	while temp1 < temp0
		GetTextInfo(temp2, 1, TEXTINFO_TEXTDATA, 90, temp1)
		if temp2 > 64
			temp2 -= 65
			GetTableValue(temp4, temp2, headerspace)
			temp3 -= temp4
			temp5 += temp4
		else
			temp3 -= 3
			temp5 += 3
		end if
		temp1++
	loop
	temp3 >>= 1
	temp5 >>= 1
	temp3 += screen.xcenter
	temp5 += screen.xcenter	
	DrawSpriteScreenXY(308, temp3, 25)
	temp4 = temp3
	while temp4 < temp5
		DrawSpriteScreenXY(310, temp4, 25)
		temp4++
	loop
	DrawSpriteScreenXY(309, temp5, 25)
	GetTextInfo(temp0, 1, TEXTINFO_TEXTSIZE, 90, 0)
	temp1 = 0
	while temp1 < temp0
		GetTextInfo(temp2, 1, TEXTINFO_TEXTDATA, 90, temp1)
		if temp2 > 64
			temp2 -= 65
			GetTableValue(temp4, temp2, headerspace)
			temp2 += 282
			DrawSpriteScreenXY(temp2, temp3, 20)
			temp3 += temp4
		else
			temp3 += 3
		end if
		temp1++
	loop
end function

event ObjectDraw
	//CallFunction(Mod_BG)
	DrawRect(0, 0, screen.xsize, screen.ysize, color5, color5, color5, 200)
	
	SetActivePalette(1, 0, 256)
	if modcount > 0
		mod.min.scroll = object.modhighlight
		mod.min.scroll *= 36
		mod.max.scroll = mod.min.scroll
		mod.min.scroll -= 110
		if saved.mobile == 1
			mod.min.scroll += 20
			mod.max.scroll -= 20
		end if
		
		if mod.menu.scroll < mod.min.scroll
			mod.menu.scroll = mod.min.scroll
		else
			if mod.menu.scroll > mod.max.scroll
				mod.menu.scroll = mod.max.scroll
			end if
		end if
		
		if mod.menu.scroll < 0
			mod.menu.scroll = 0
		end if
		temp0 = modcount
		temp0--
		temp0 *= 36
		temp0 -= 110
		if temp0 < 0
			temp0 = 0
		end if
		if mod.menu.scroll > temp0
			mod.menu.scroll = temp0
		end if
		
		line.ypos = 61
		line.ypos -= mod.menu.scroll
		object.modtodraw = 0
		while object.modtodraw < modcount
			CallFunction(Mod_Draw)
			object.modtodraw++
			line.ypos += 36
		loop
		
		CallFunction(Mod_Description)
	else		
		CallFunction(Mod_Gone)
	end if
	
	CallFunction(Mod_Header)

	ClassicTint(0, 0, screen.xsize, screen.ysize, 0, 0, 0, mods.exTime)

	if loading == 1
		EditFrame(0, -67, -12, 133, 23, 118, 518)
		LoadSpriteSheet("DDLCMenu/Menu.gif")
		DrawSpriteScreenXY(0, screen.xcenter, screen.ycenter)
	end if
	SetActivePalette(0, 0, 256)	
end event

function mods.pop
	SetupMenu(0, 0, 0, 0)
	CallNativeFunction(GetModCount)
	modcount = checkResult
	if modcount > 0
		temp0 = 0
		while temp0 < modcount
			CallNativeFunction4(GetModName, 0, 0, temp0, 0)
			CallNativeFunction4(GetModVersion, 0, 0, temp0, 0)
			CallNativeFunction4(GetModAuthor, 0, 0, temp0, 0)
			CallNativeFunction4(GetModDescription, 0, 0, temp0, 0)
			temp0++
		loop
	else
		switch saved.language 
			default
				AddMenuEntry(0, "No Mods Detected", 0)
				AddMenuEntry(0, "Check out the modding", 0)
				AddMenuEntry(0, "community at GameBanana", 0)
			break
			case 1
				AddMenuEntry(0, "Nenhum mod foi detectado", 0)
          		AddMenuEntry(0, "Olhe a comunidade", 0)
           		AddMenuEntry(0, "de mods no GameBanana", 0)
			break
			case 2
           		AddMenuEntry(0, "No Se Detectan Mods", 0)
           		AddMenuEntry(0, "Revisa la comunidad", 0)
          		AddMenuEntry(0, "de mods de GameBanana", 0)
			break
		end switch
	end if		
end function

event ObjectStartup
	CallFunction(mods.pop)
	LoadSpriteSheet("Menus/Options.gif")
	if saved.dokiTracks > 0
		SetMusicTrack("DokiMix/ModList.ogg", 1, 2837874)
	else	
		SetMusicTrack("ModList.ogg", 1, 1)
	end if	
	

	//Load font sprites
	temp0 = 0
	temp1 = 0
	while temp0 < 88
		while temp1 < 128
			SpriteFrame(0, 0, 8, 8, temp1, temp0)
			temp1 += 8
		loop
		temp1 = 0
		temp0 += 8
	loop
	
	//Start second font at 176
	SpriteFrame(0, 0, 3, 12, 129, 1)
	SpriteFrame(0, 0, 6, 12, 133, 1)
	SpriteFrame(0, 0, 10, 12, 140, 1)
	SpriteFrame(0, 0, 9, 12, 151, 1)	
	SpriteFrame(0, 0, 9, 12, 161, 1)
	SpriteFrame(0, 0, 9, 12, 171, 1)
	SpriteFrame(0, 0, 3, 12, 181, 1)
	SpriteFrame(0, 0, 4, 12, 185, 1)
	SpriteFrame(0, 0, 4, 12, 190, 1)
	SpriteFrame(0, 0, 7, 12, 195, 1)
	SpriteFrame(0, 0, 9, 12, 203, 1)
	SpriteFrame(0, 0, 3, 12, 213, 1)
	SpriteFrame(0, 0, 7, 12, 217, 1)
	SpriteFrame(0, 0, 3, 12, 225, 1)
	SpriteFrame(0, 0, 11, 12, 229, 1)
	SpriteFrame(0, 0, 7, 12, 241, 1)
	SpriteFrame(0, 0, 5, 12, 249, 1)
	SpriteFrame(0, 0, 7, 12, 129, 14)	
	SpriteFrame(0, 0, 7, 12, 137, 14)
	SpriteFrame(0, 0, 7, 12, 145, 14)
	SpriteFrame(0, 0, 7, 12, 153, 14)
	SpriteFrame(0, 0, 7, 12, 161, 14)
	SpriteFrame(0, 0, 7, 12, 169, 14)
	SpriteFrame(0, 0, 7, 12, 177, 14)
	SpriteFrame(0, 0, 7, 12, 185, 14) //200
	SpriteFrame(0, 0, 3, 12, 193, 14)
	SpriteFrame(0, 0, 3, 12, 197, 14)
	SpriteFrame(0, 0, 6, 12, 201, 14)
	SpriteFrame(0, 0, 6, 12, 208, 14)
	SpriteFrame(0, 0, 6, 12, 215, 14)
	SpriteFrame(0, 0, 6, 12, 222, 14)
	SpriteFrame(0, 0, 10, 12, 229, 14)	
	SpriteFrame(0, 0, 9, 12, 240, 14)
	SpriteFrame(0, 0, 8, 12, 129, 27)
	SpriteFrame(0, 0, 9, 12, 138, 27)
	SpriteFrame(0, 0, 9, 12, 148, 27)
	SpriteFrame(0, 0, 7, 12, 158, 27)
	SpriteFrame(0, 0, 7, 12, 166, 27)
	SpriteFrame(0, 0, 9, 12, 174, 27)
	SpriteFrame(0, 0, 11, 12, 184, 27)
	SpriteFrame(0, 0, 5, 12, 196, 27)
	SpriteFrame(0, 0, 8, 12, 202, 27)
	SpriteFrame(0, 0, 9, 12, 211, 27)
	SpriteFrame(0, 0, 6, 12, 221, 27)
	SpriteFrame(0, 0, 11, 12, 228, 27) //220
	SpriteFrame(0, 0, 9, 12, 240, 27)
	SpriteFrame(0, 0, 10, 12, 129, 40)
	SpriteFrame(0, 0, 7, 12, 140, 40)
	SpriteFrame(0, 0, 10, 12, 148, 40)
	SpriteFrame(0, 0, 7, 12, 159, 40)
	SpriteFrame(0, 0, 7, 12, 167, 40)
	SpriteFrame(0, 0, 9, 12, 175, 40)
	SpriteFrame(0, 0, 10, 12, 185, 40)
	SpriteFrame(0, 0, 9, 12, 196, 40)
	SpriteFrame(0, 0, 15, 12, 206, 40)
	SpriteFrame(0, 0, 9, 12, 222, 40)
	SpriteFrame(0, 0, 11, 12, 232, 40)
	SpriteFrame(0, 0, 9, 12, 244, 40)	
	SpriteFrame(0, 0, 4, 12, 129, 53)
	SpriteFrame(0, 0, 11, 12, 134, 53)
	SpriteFrame(0, 0, 4, 12, 146, 53)
	SpriteFrame(0, 0, 5, 12, 151, 53)
	SpriteFrame(0, 0, 7, 12, 157, 53)
	SpriteFrame(0, 0, 4, 12, 165, 53)	
	SpriteFrame(0, 0, 9, 12, 240, 14) //240
	SpriteFrame(0, 0, 8, 12, 129, 27)
	SpriteFrame(0, 0, 9, 12, 138, 27)
	SpriteFrame(0, 0, 9, 12, 148, 27)
	SpriteFrame(0, 0, 7, 12, 158, 27)
	SpriteFrame(0, 0, 7, 12, 166, 27)
	SpriteFrame(0, 0, 9, 12, 174, 27)
	SpriteFrame(0, 0, 11, 12, 184, 27)
	SpriteFrame(0, 0, 5, 12, 196, 27)
	SpriteFrame(0, 0, 8, 12, 202, 27)
	SpriteFrame(0, 0, 9, 12, 211, 27)
	SpriteFrame(0, 0, 6, 12, 221, 27)
	SpriteFrame(0, 0, 11, 12, 228, 27)
	SpriteFrame(0, 0, 9, 12, 240, 27)
	SpriteFrame(0, 0, 10, 12, 129, 40)
	SpriteFrame(0, 0, 7, 12, 140, 40)
	SpriteFrame(0, 0, 10, 12, 148, 40)
	SpriteFrame(0, 0, 7, 12, 159, 40)
	SpriteFrame(0, 0, 7, 12, 167, 40)
	SpriteFrame(0, 0, 9, 12, 175, 40)
	SpriteFrame(0, 0, 10, 12, 185, 40) //260
	SpriteFrame(0, 0, 9, 12, 196, 40)
	SpriteFrame(0, 0, 15, 12, 206, 40)
	SpriteFrame(0, 0, 9, 12, 222, 40)
	SpriteFrame(0, 0, 11, 12, 232, 40)
	SpriteFrame(0, 0, 9, 12, 244, 40)	
	SpriteFrame(0, 0, 5, 12, 170, 53)
	SpriteFrame(0, 0, 3, 12, 176, 53)
	SpriteFrame(0, 0, 5, 12, 180, 53)
	SpriteFrame(0, 0, 9, 12, 186, 53) //269
	
	
	SpriteFrame(-44, -5, 44, 21, 1, 88) //270 Mod On
	SpriteFrame(-44, -5, 44, 21, 46, 88) //271 Mod Off
	SpriteFrame(0, -5, 28, 20, 1, 132) //272 Cartridge
	SpriteFrame(0, 0, 136, 21, 1, 110) //273 BLANK
	SpriteFrame(0, 0, 8, 8, 91, 88) //274 BG square 1
	SpriteFrame(0, 0, 24, 24, 30, 132) //275 BG square 2
	
	SpriteFrame(-2, -2, 3, 3, 100, 88) //276 Star1
	SpriteFrame(-3, -3, 5, 5, 100, 92) //277 Star2
	SpriteFrame(-4, -4, 7, 7, 100, 98) //278 Star3
	SpriteFrame(-8, -8, 15, 15, 108, 88) //279 Star4
	SpriteFrame(-9, -9, 17, 17, 124, 88) //280 Star5
	SpriteFrame(-11, -11, 21, 21, 142, 88) //281 Star6
	
	//Header font starts at 282
	SpriteFrame(0, 0, 17, 18, 138, 110) //282 A Header Alphabet
	SpriteFrame(0, 0, 17, 18, 156, 110)
	SpriteFrame(0, 0, 17, 18, 174, 110)
	SpriteFrame(0, 0, 17, 18, 192, 110)
	SpriteFrame(0, 0, 16, 18, 210, 110) //E
	SpriteFrame(0, 0, 16, 18, 227, 110)	
	SpriteFrame(0, 0, 18, 18, 244, 110)
	SpriteFrame(0, 0, 17, 18, 263, 110)
	SpriteFrame(0, 0, 8, 18, 281, 110) //290 I
	SpriteFrame(0, 0, 16, 18, 290, 110)
	SpriteFrame(0, 0, 18, 18, 307, 110)
	SpriteFrame(0, 0, 17, 18, 326, 110)
	SpriteFrame(0, 0, 18, 18, 344, 110) //M
	SpriteFrame(0, 0, 17, 18, 363, 110)
	SpriteFrame(0, 0, 18, 18, 138, 129) //
	SpriteFrame(0, 0, 17, 18, 157, 129)
	SpriteFrame(0, 0, 18, 18, 175, 129)
	SpriteFrame(0, 0, 18, 18, 194, 129) // R
	SpriteFrame(0, 0, 16, 18, 213, 129) //300
	SpriteFrame(0, 0, 16, 18, 230, 129)
	SpriteFrame(0, 0, 17, 18, 247, 129)
	SpriteFrame(0, 0, 17, 18, 265, 129)
	SpriteFrame(0, 0, 24, 18, 283, 129)
	SpriteFrame(0, 0, 17, 18, 308, 129)
	SpriteFrame(0, 0, 17, 18, 326, 129)
	SpriteFrame(0, 0, 17, 18, 344, 129) //307 Z
		
	SpriteFrame(-17, 0, 17, 19, 304, 89) //308 Left Header Triangle
	SpriteFrame(0, 0, 17, 19, 322, 89) //309 Right Header Triangle
	SpriteFrame(0, 0, 1, 19, 322, 89) //310 Middle Bar
	SpriteFrame(-48, 0, 14, 14, 113, 125) //311 Up Arrow
	SpriteFrame(-48, 0, 14, 14, 113, 140) //312 Down Arrow

	SpriteFrame(0, -5, 28, 20, 579, 148) //313 Reorder Arrows
	SpriteFrame(0, -4, 12, 8, 579, 169) //314 Reorder Up Arrow Red
	SpriteFrame(0, 6, 12, 9, 592, 169) //315 Reorder Down Arrow Red
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
